package com.xu.mylol.fragment;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.xu.mylol.R;
import com.xu.mylol.acyivity.QueryActivity;

/**
 * Created by dllo on 16/1/8.
 */
public class Fragment_Query extends Fragment implements View.OnClickListener {
    private Toolbar toolbar;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_query,null);
        toolbar = (Toolbar) view.findViewById(R.id.query_toolbar);
        toolbar.setTitle("欢迎来到查询联盟");
        return  view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        view.findViewById(R.id.btn_yinchang).setOnClickListener(this);
        view.findViewById(R.id.btn_zhandou).setOnClickListener(this);
        view.findViewById(R.id.btn_shangdan).setOnClickListener(this);
        view.findViewById(R.id.btn_zhongdan).setOnClickListener(this);
        view.findViewById(R.id.btn_ad).setOnClickListener(this);
        view.findViewById(R.id.btn_benming).setOnClickListener(this);
        view.findViewById(R.id.btn_guanjian).setOnClickListener(this);
        view.findViewById(R.id.btn_kengdie).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_yinchang:
                Intent intent  = new Intent(getActivity(), QueryActivity.class);
                intent.putExtra("yinchang","http://www.lolhelper.cn/rank.php");
                startActivity(intent);
                break;
            case R.id.btn_zhandou:
                Intent intent_z  = new Intent(getActivity(), QueryActivity.class);
                intent_z.putExtra("zhandou"," http://zdl.mbox.duowan.com/phone/playerDetailNew.php");
                startActivity(intent_z);
                break;
            case R.id.btn_shangdan:
                Intent intent_s  = new Intent(getActivity(), QueryActivity.class);
                intent_s.putExtra("shangdan","http://www.lolhelper.cn/analyse_top.php");
                startActivity(intent_s);
                break;
            case R.id.btn_zhongdan:
                Intent intent_zd  = new Intent(getActivity(), QueryActivity.class);
                intent_zd.putExtra("zhongdan","http://www.lolhelper.cn/analyse_mid.php");
                startActivity(intent_zd);
                break;
            case R.id.btn_ad:
                Intent intent_a  = new Intent(getActivity(), QueryActivity.class);
                intent_a.putExtra("ad","http://www.lolhelper.cn/analyse_adc.php");
                startActivity(intent_a);
                break;
            case R.id.btn_benming:
                Intent intent_b  = new Intent(getActivity(), QueryActivity.class);
                intent_b.putExtra("benming","http://word.lolhelper.cn/analyse_best.php");
                startActivity(intent_b);
                break;
            case R.id.btn_guanjian:
                Intent intent_g  = new Intent(getActivity(), QueryActivity.class);
                intent_g.putExtra("guanjian","http://service.mbox.duowan.com/index.php");
                startActivity(intent_g);
                break;
            case R.id.btn_kengdie:
                Intent intent_k  = new Intent(getActivity(), QueryActivity.class);
                intent_k.putExtra("kengdie","http://www.lolhelper.cn/analyse_kengdie.php");
                startActivity(intent_k);
                break;

        }
    }
}
